CREATE TABLE [dbo].[TDMOVI_TRBA]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_BANC] [dbo].[TD_VC_003] NOT NULL,
[CO_UNID_CONC] [dbo].[TD_VC_003] NOT NULL,
[NU_CNTA_BANC] [dbo].[TD_VC_020] NOT NULL,
[AA_BNCO] [dbo].[TD_VC_004] NOT NULL,
[MM_BNCO] [dbo].[TD_VC_002] NOT NULL,
[TI_MOVI_BANC] [dbo].[TD_VC_001] NOT NULL,
[NU_COMP_BANC] [dbo].[TD_VC_008] NOT NULL,
[NU_SECU] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TDMOVI_TR__NU_SE__7EACC042] DEFAULT ((0)),
[CO_EMPR_DEST] [dbo].[TD_VC_002] NULL,
[CO_BANC_DEST] [dbo].[TD_VC_003] NULL,
[NU_CNTA_DEST] [dbo].[TD_VC_020] NULL,
[AA_BNCO_DEST] [dbo].[TD_VC_004] NULL,
[MM_BNCO_DEST] [dbo].[TD_VC_002] NULL,
[TI_MOVI_DEST] [dbo].[TD_VC_001] NULL,
[NU_COMP_DEST] [dbo].[TD_VC_008] NULL,
[CO_TIPO_DOCU] [dbo].[TD_VC_003] NULL,
[NU_DOCU_BANC] [dbo].[TD_VC_020] NULL,
[FE_OPER] [dbo].[TD_DT_001] NULL,
[FE_DISP] [dbo].[TD_DT_001] NULL,
[CO_TIPO_OPER] [dbo].[TD_VC_003] NULL,
[FA_TIPO_CAMB] [dbo].[TD_NU_015_006] NOT NULL CONSTRAINT [DF__TDMOVI_TR__FA_TI__7FA0E47B] DEFAULT ((1.000)),
[IM_MOVI] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TDMOVI_TR__IM_MO__009508B4] DEFAULT ((0)),
[IM_CONV] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TDMOVI_TR__IM_CO__01892CED] DEFAULT ((0)),
[DE_OBSE] [dbo].[TD_VC_100] NULL,
[CO_SUBR] [dbo].[TD_VC_003] NULL,
[TI_DOCU] [dbo].[TD_VC_003] NULL,
[NU_DOCU] [dbo].[TD_VC_020] NULL,
[TI_MOVI] [dbo].[TD_VC_001] NULL,
[CO_CNTA_EMPR] [dbo].[TD_VC_020] NULL,
[TI_ENTI] [dbo].[TD_VC_001] NULL,
[CO_ENTI] [dbo].[TD_VC_020] NULL,
[CO_ORDE_SERV] [dbo].[TD_VC_020] NULL,
[CO_UNID_DEST] [dbo].[TD_VC_003] NULL,
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDMOVI_TR__FE_US__027D5126] DEFAULT (getdate()),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDMOVI_TR__CO_US__0371755F] DEFAULT (suser_sname()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDMOVI_TR__CO_US__04659998] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDMOVI_TR__FE_US__0559BDD1] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDMOVI_TRBA] ADD CONSTRAINT [PK__TDMOVI_T__FF89FA26054F9C30] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_BANC], [CO_UNID_CONC], [NU_CNTA_BANC], [AA_BNCO], [MM_BNCO], [TI_MOVI_BANC], [NU_COMP_BANC], [NU_SECU]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDMOVI_TRBA] ADD CONSTRAINT [FK__TDMOVI_TRBA__5E20C076] FOREIGN KEY ([CO_EMPR], [CO_BANC], [CO_UNID_CONC], [NU_CNTA_BANC], [AA_BNCO], [MM_BNCO], [TI_MOVI_BANC], [NU_COMP_BANC]) REFERENCES [dbo].[TCMOVI_BANC] ([CO_EMPR], [CO_BANC], [CO_UNID_CONC], [NU_CNTA_BANC], [AA_BNCO], [MM_BNCO], [TI_MOVI_BANC], [NU_COMP_BANC])
GO
ALTER TABLE [dbo].[TDMOVI_TRBA] ADD CONSTRAINT [FK__TDMOVI_TRBA__5F14E4AF] FOREIGN KEY ([CO_EMPR], [CO_TIPO_OPER]) REFERENCES [dbo].[TTTIPO_OPER] ([CO_EMPR], [CO_TIPO_OPER])
GO
